package com.flot.yazb.widget;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.flot.yazb.R;
import com.flot.yazb.base.BActivity;
import com.flot.yazb.base.BDialog;
import com.flot.yazb.home.setting.PayVipActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by fengdongfei on 2017/8/31.
 */

public class PayDialog extends BDialog {

    private  BActivity activity;
    private String desc;
    @BindView(R.id.tvContent)
    TextView tvContent;
    @BindView(R.id.cancle)
    TextView cancle;
    @BindView(R.id.ok)
    TextView ok;

    public PayDialog(Context context, String con) {
        super(context);
        this.desc = con;
    }
    public PayDialog(Context context, String con, BActivity activity) {
        super(context);
        this.desc = con;
        this.activity=activity;
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_pay);
        ButterKnife.bind(this);

        tvContent.setText(desc);
    }

    @Override
    public boolean isCancelable(boolean b) {
        return true;
    }

    @Override
    public int setGravity(int gravity) {
        return 0;
    }

    @Override
    public int setPadWidth(float width) {
        return 0;
    }

    @Override
    public int setPadHeight(float height) {
        return 0;
    }

    @OnClick({R.id.cancle, R.id.ok})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.cancle:
                dismiss();
                break;
            case R.id.ok:
                Intent intent = new Intent(this.getContext(), PayVipActivity.class);
                getOwnerActivity().startActivity(intent);
                dismiss();
                break;
        }
    }
}
